<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("modelConfigPath", "cargo");
%>
<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<style type="text/css">
	
</style>

<script src="<c:url value='/js/gallery/jquery.ad-gallery.js'/>" type="text/javascript"></script>
<link href="<c:url value='/css/gallery/jquery.ad-gallery.css'/>" rel="stylesheet" type="text/css"/>

<t:panel cssClass="panel-flat form-detailed" customBody="true" customHead="true">
	<div class="detailed-navbar-content panel-body" style="margin-bottom:0px;">
		<div id="gallery" class="ad-gallery col-md-7 col-sm-7 "> 
		  <div class="ad-image-wrapper" style="height:400px;width:600px"></div> 
		  <div class="ad-controls"></div> 
		  <div class="ad-nav"> 
		    <div class="ad-thumbs"> 
		      <ul class="ad-thumb-list" style="width:100%; height:100%; display:inline-flex"> 
		        
		    <c:forEach var="picture" items="${cargo.pictures}" varStatus="status">
		    	<c:if test="${picture.fileId==null }">
           			<li>
		              <a href="<c:url value='/images/logo.png'/>" class="ad-thumb1">
		                <img  src="<c:url value='/images/logo.png'/>"   class="image1" style="opacity: 0.7; height:90px;width:90px">
		              </a>
		            </li>
           		</c:if>	
           		<c:if test="${picture.fileId!=null }">
           			<li>
		              <a href="${tfile:getImageUrl(picture.fileId)}" class="ad-thumb1">
		                <img  src="${tfile:getImageUrl(picture.fileId)}"  class="image1" style="opacity: 0.7; height:90px;width:90px">
		              </a>
		            </li>
           		</c:if>	
	         </c:forEach>   
		      </ul> 
		    </div> 
		  </div> 
		</div>
		<div class="col-md-5 col-sm-5">
		<h2 style="margin-left:20px">${cargo.cargoName }</h2>
		<span style="color:#91A4B0">分类：${cargo.categoryName }</span> <span style="margin-left:30px;color:#91A4B0">编号：${cargo.cargoNo }</span><span style="margin-left:30px;color:#91A4B0">基本单位：${cargo.unit }</span>
		<div class="panel-header" style="height:60px;background-color:#F9F9FD;margin:0 auto  ">
            
            <label style="font-size:1.0em;margin-left:20px"> 成本价:<span id="costPrice" style="color:red;font-size:1.6em"></span></label>	
            <label  style="font-size:1.0em;margin-top:10px;margin-left:20px">销售价 : <span style="color:red;font-size:1.6em">${cargo.minSale }~${cargo.maxSale }</span></label>	
		 </div>
		 <h6>产品规格列表</h6>
		 <div class="table-responsive" style="height:220px" >
		 <table class="cntable table table-bordered dataTable " >
		 	<div class="table-head">
		 	<thead   >
		 		<th>规格</th>
		 		<th>成本价</th>
		 		<th>销售价</th>
		 		<th>库存</th>
		 		<th>销量</th>
		 	</thead>
		 	 </div>
		 	 <div class="table-body">
		 	<tbody>
			 	<c:forEach var="collocation" items="${collocations}" varStatus="status">
			 		<tr style="height:30px">
			 			<td>${collocation.propertyNameOne }*${collocation.propertyNameTwo }</td>
			 			<td class="costPrice">${collocation.costPrice }</td>
			 			<td>${collocation.salePrice }</td>
			 			<td>${collocation.stockNum }</td>
			 			<td>${collocation.saleNum+0 }</td>
			 		</tr>
			 	</c:forEach>
		 	</tbody>
		 </table>
		 </div>
	</div>
	</div>
	
		
</t:panel>



<script type="text/javascript">
$(function(){ 
	   $('.ad-gallery').adGallery(); 
	  
	   $(".ad-slideshow-start").text("开始");
	   $(".ad-slideshow-stop").text("停止");
	   $(".ad-nav").css("margin-left","20px");
	   
	   var max=0;
	   var min=0;
	   $("td.costPrice").each(function(){
		   var costPrice=Number($(this).text())
		  
		   if(max<costPrice){
			   max=costPrice;
		   }
		   if(min>costPrice){
			   min=costPrice;
		   }
	   })
	   
	   $("#costPrice").text(min+"~"+max)
	   
	   console.log(max+"最大值")
	   console.log(min+"最小值")
	}); 




</script>
<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formbuttons.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/dialog.jsp"%>
<%@ include file="/WEB-INF/views/shared//master/contentFooter.jsp"%>
